//
//  UIScrollView+MJRefreshConfig.m
//  laziz_Merchant
//
//  Created by XMac on 17/3/14.
//  Copyright © 2017年 XBN. All rights reserved.
//

#import "UIScrollView+MJRefreshConfig.h"
#import "MJRefreshAutoNormalFooter.h"
#import "MJRefreshNormalHeader.h"

@implementation UIScrollView (MJRefreshConfig)
- (void)configHeaderRefreshText {
    MJRefreshNormalHeader *header = (MJRefreshNormalHeader*)self.mj_header;
    // 设置自动切换透明度(在导航栏下面自动隐藏)
    header.automaticallyChangeAlpha = YES;
    // 隐藏时间
    header.lastUpdatedTimeLabel.hidden = YES;
    
    // 设置文字
    [header setTitle:LZLocalizedString(@"refresh_header_pull_down", nil) forState:MJRefreshStateIdle];
    [header setTitle:LZLocalizedString(@"refresh_header_release_to_refresh", nil) forState:MJRefreshStatePulling];
    [header setTitle:LZLocalizedString(@"refresh_loading", nil) forState:MJRefreshStateRefreshing];
    
}

- (void)configFooterRefreshText {
    MJRefreshAutoNormalFooter *footer = (MJRefreshAutoNormalFooter*)self.mj_footer;
    [footer setTitle:LZLocalizedString(@"refresh_footer_pull_up", nil) forState:MJRefreshStateIdle];
    [footer setTitle:LZLocalizedString(@"refresh_loading", nil) forState:MJRefreshStateRefreshing];
}

- (void)setNoDataFooterText {
    MJRefreshAutoNormalFooter *footer = (MJRefreshAutoNormalFooter*)self.mj_footer;
    [footer setTitle:LZLocalizedString(@"refresh_footer_no_data", nil) forState:MJRefreshStateNoMoreData];
    
}

- (void)setNoMoreDataFooterText {
    MJRefreshAutoNormalFooter *footer = (MJRefreshAutoNormalFooter*)self.mj_footer;
    [footer setTitle:LZLocalizedString(@"refresh_footer_no_more_data", nil) forState:MJRefreshStateNoMoreData];
}

@end
